<?php
defined('BY_JYA') or exit('error');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();
if($_RQ['op']=='get'){
	$return['item']=array();
	//$from='$from';
	//$to='$to';
	//$return['item']['func']="cfc('jy_wxtranslation')->translation($from,$to), 其中$from 为源语言 zh_CN或 en_US，$to 为目标语言 zh_CN或 en_US";
	$return['htmls']=array (
		  'type' => 'edit',
		  'post' => 'post',
		  'edit_tab' => '调用方法',
		  'edits' => 
		  array (
		    0 => 
		    array (
		      'title' => '调用方法',
		      'list' => 
		      array (
				array ('name' => 'from','type' => 'radio','title' => '设置源语言','options'=>'lang'),
				array ('name' => 'to','type' => 'radio','title' => '设置目标语言','options'=>'lang'),
		      ),
		    ),
		  ),
		);
	$return['lang']=array('zh_CN'=>'中文','en_US'=>'英文');
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	if(!$postdata['from']){
		exi('请选择源语言','error');
	}
	if(!$postdata['from']){
		exi('请选择目标语言','error');
	}
	$_SESSION['trset']=$postdata;
	//$this->save_setting($postdata);
	
	exi('设置成功！','','/setting/show');
}
if($_RQ['op']=='show'){
	$postdata=$_SESSION['trset'];
	//print_r($postdata);exit;
	$from=$postdata['from'];
	$to=$postdata['to'];
	$string='$string';
	$return['item']['func']="cfc('jy_wxtranslation')->translation('$from','$to',$string), 其中$from 为源语言，$to 为目标语言,$string 为 需要翻译的内容";
	$return['htmls']=array (
		  'type' => 'edit',
		  'post' => 'post',
		  'edit_tab' => '接口调用方法',
		  'edits' => 
		  array (
		    0 => 
		    array (
		      'title' => '接口调用方法',
		      'list' => 
		      array (
				array ('name' => 'func','type' => 'string','title' => '插件调用方法为','help'=>'','read'=>true),
		       
		      ),
		    ),
		  ),
		);
		exi($return);
}
?>